<template>
    <div class="drawerContainer">
        <el-form :model="propJson" label-width="auto" style="width: 100%">
            <el-form-item label="图片填充方式">
                <el-select v-model="propJson.imageFit" placeholder="图片填充方式" style="width: 100%">
                    <el-option label="自动填充" value="fill" />
                    <el-option label="自适应" value="contain" />
                    <el-option label="自放大" value="cover" />
                    <el-option label="自缩小" value="scale-down" />
                    <el-option label="无操作" value="none" />
                </el-select>
            </el-form-item>

            <el-form-item label="图片宽度">
                <el-input v-model="propJson.imageWidth" style="width: 100%"/>
            </el-form-item>

            <el-form-item label="图片高度">
                <el-input v-model="propJson.imageHeight" style="width: 100%"/>
            </el-form-item>

            <el-form-item label="是否为图片列表">
                <el-radio-group v-model="propJson.isList">
                    <el-radio :label="true">是</el-radio>
                    <el-radio :label="false">否</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label="是否展示预览">
                <el-radio-group v-model="propJson.isPreview">
                    <el-radio :label="true">是</el-radio>
                    <el-radio :label="false">否</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-divider>图片地址</el-divider>

            <CommonThirdServiceValue :actionInfo="propJson.imgUrlInfo ? propJson.imgUrlInfo : {}" :commonParam="commonParam" />
        </el-form>
    </div>
</template>

<script name="ImageDrawer" setup lang="ts">
import {computed, defineProps} from "vue";
import {useLowCodeStore} from "@/stores/lowcode/lowcode";
import CommonThirdServiceValue from "@/components/lowcode/service/CommonThirdServiceValue.vue"

let props = defineProps(['commonParam']);

let commonParam = computed(() => {return props['commonParam']})

let propJson = computed(() => {return useLowCodeStore().lowCodeDrawerJsonInfo});
</script>

<style scoped lang="less">

</style>